package com.scalar.forecast.forecastEntry;

import java.util.LinkedList;

/**
 * User: Sujan Kumar
 * Date: Feb 14, 2005
 * Time: 12:11:48 PM
 */
public class RowData
{
    private int maxLevelOrder;
    private int levelOrder;
    private int salesPersonId;
    private String salesPersonName;
    private LinkedList slotDataList;
    private boolean selected;

    private boolean showActualData; //This parameter is used whether to show actual data or not while displaying the table data.

    private boolean hasChilds;

    public RowData()
    {
        maxLevelOrder = -1;
        levelOrder = -1;
        salesPersonId = -1;
        slotDataList = new LinkedList();
        selected = false;
        showActualData = false;
        hasChilds = false;
    }

    public RowData ( RowData rowData ) //copyConstructor
    {
		if ( rowData != null )
		{
			this.maxLevelOrder = rowData.getMaxLevelOrder();
			this.levelOrder = rowData.getLevelOrder();
			this.salesPersonId = rowData.salesPersonId;
			this.salesPersonName = rowData.getSalesPersonName();
			LinkedList slotDataList = rowData.getSlotDataList();
			LinkedList copyOfSlotDataList = new LinkedList();
			if ( slotDataList != null )
			{
				int slotDataListSize = slotDataList.size();
				SlotData slotData =  null;
				for ( int i=0; i < slotDataListSize; i++ )
				{
					slotData = ( SlotData )slotDataList.get ( i );
					copyOfSlotDataList.add ( new SlotData ( slotData ) );
				}
			}
			this.slotDataList = copyOfSlotDataList;
			this.selected = rowData.isSelected();
		}
    }
    public int getLevelOrder()
    {
        return levelOrder;
    }

    public void setLevelOrder(int levelOrder)
    {
        this.levelOrder = levelOrder;
    }

    public int getMaxLevelOrder()
    {
        return maxLevelOrder;
    }

    public void setMaxLevelOrder(int maxLevelOrder)
    {
        this.maxLevelOrder = maxLevelOrder;
    }

    public int getSalesPersonId()
    {
        return salesPersonId;
    }

    public void setSalesPersonId(int salesPersonId)
    {
        this.salesPersonId = salesPersonId;
    }

    public LinkedList getSlotDataList()
    {
        return slotDataList;
    }

    public String getSalesPersonName()
    {
        return salesPersonName;
    }

    public void setSalesPersonName(String salesPersonName)
    {
        this.salesPersonName = ( salesPersonName == null ? null : salesPersonName.trim() );
    }

    public void setSlotDataList(LinkedList slotDataList)
    {
        this.slotDataList = slotDataList;
    }

    public boolean isSelected()
    {
        return selected;
    }

    public void setSelected(boolean selected)
    {
        this.selected = selected;
    }

    public boolean isShowActualData()
    {
        return showActualData;
    }

    public void setShowActualData( boolean showActualData )
    {
        this.showActualData = showActualData;
    }

    public boolean isHasChilds()
    {
        return hasChilds;
    }

    public void setHasChilds(boolean hasChilds)
    {
        this.hasChilds = hasChilds;
    }
}
